﻿using System;
using NUnit.Framework;

namespace SharePoint.Orm.Helpers {
    class GrandParent{}
    class Parent : GrandParent {}
    class Child : Parent {}
    class Brother : Parent {}
    [TestFixture]
    public class TypeHelperTest {
        [Test]
        public void HasDescendant_ReturnsTrue() {
            Type child = typeof (Child);
            Type grandParent = typeof (GrandParent);
            Assert.IsTrue(child.IsDescendantOf(grandParent));
        }
        [Test]
        public void IsBrother_ReturnsFalse() {
            Type child = typeof(Child);
            Type brother = typeof (Brother);
            Assert.IsFalse(child.IsDescendantOf(brother));
        }
    }
}
